#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include <vector>
#include <stdint.h>
#include <string>

namespace opennav {

enum FontStyle {
	FONT_PLAIN,
	FONT_BOLD,
	FONT_ITALIC
};

struct Point {
	Point() : x(0), y(0) { }
	Point(int32_t px, int32_t py) : x(px), y(py) { }
	int32_t x;
	int32_t y;
};

struct Dimension {
	Dimension() : width(0), height(0) { }
	Dimension(int32_t w, int32_t h) : width(w), height(h) { }
	int32_t width;
	int32_t height;
};

struct Font {
	Font(int32_t font_size, FontStyle font_style) : size(font_size), style(font_style) { }
	int32_t size;
	FontStyle style;
};

struct Color {
	Color() : r(0), g(0), b(0) { }
	Color(uint32_t rgb) : r((rgb >> 16) & 0xff), g((rgb >> 8) & 0xff), b(rgb & 0xff) { }
	uint8_t r;
	uint8_t g;
	uint8_t b;
};

class CanvasInterface {
public:
	virtual void set_foreground_color(Color& color) = 0;
	virtual void set_background_color(Color& color) = 0;
	virtual void set_line_width(int32_t width) = 0;
	virtual void set_font(const Font& font) = 0;
	virtual void draw_lines(const std::vector<Point>& polyline) = 0;
	virtual void draw_line(const Point& a, const Point& b) = 0;
	virtual void draw_polygon(const std::vector<Point>& polyline) = 0;
	virtual void draw_rectangle(const Point& center, int32_t width, int32_t height) = 0;
	virtual void draw_circle(const Point& center, int32_t radius) = 0;
	virtual void draw_text(const Point& point, const std::string& text) = 0;
	virtual void draw_text_tilted(const Point& center, const std::string& text, int dx, int dy) = 0;
	virtual void get_text_dimension(const std::string& text, Dimension& dimension) = 0;
	virtual int32_t width() = 0;
	virtual int32_t height() = 0;
};

}

#endif /* GRAPHICS_H_ */
